#ifndef _WORLD_H
#define _WORLD_H

class MapHandler;

class DLL_EXPORT World : public Single<World>
{
	friend class MiscManager;
	bool m_isinit;
	map<ui32, MapHandler*> m_maphandlers;
	Mutex m_sessionlock;
	stdext::hash_map<ui32, Session*> m_activesessions;
public:
	World() : m_isinit(false)
	{
	}
	void Init();
	MapHandler* GetMapHandler(ui32 mapid);

	void SendWorldText(const char* message, ...);
	void SendWorldTextToHorde(const char* message, ...);
	void SendWorldTextToAlliance(const char* message, ...);
	void SendWorldScreenText(const char* message, ...);

	void SendPacketToFaction(RealmPacket& data, bool horde);

	//	Config-values
	const char* motd;
	WoWString annh;
	WoWString anna;
	bool autosavenpc;
	bool autosavego;
	bool autodeletenpc;
	bool autodeletego;
	bool checkareaonmove;

	void AddActiveSession(Session* sess);
	void RemoveSession(ui32 accountid);
};

#define sWorld (*World::getSingle())

#endif